<%
# View which displays a single incident's information.  
#
# Author::      Eli Fox-Epstein, efoxepstein@wesleyan.edu
# Author::      Dimitar Gochev, dimitar.gochev@trincoll.edu
# Copyright::   Humanitarian FOSS Project (http://www.hfoss.org), Copyright (C) 2009.
# License::     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
%>

<% content_for :title, title(@incident.name, 'Incidents', @instance.short_name)%>

<% content_for :body do %>
<%= flashes %>

	<h1>Page for incident: <%= @incident.name%></h1>
	<p>Description: <%= @incident.description%></p>
	<% unless @incident.updates.empty? %>
		<h2>Updates:</h2>
		<ul>
		<% @incident.updates.each do |u| %>
			<li><%= link_to u.title, instance_incident_update_url(@instance, @incident, u) %>
			<p>Posted on <%= u.created_at%> by
				<% if u.issuing_type == :user %><%= link_to u.user.full_name, instance_user_url(@instance, u.user)%>
				<% else %>
					<%= link_to u.issuing_group.name, instance_group_type_group_url(@instance, u.issuing_group.group_type, u.issuing_group)%>
				<% end %>
			</li>
		<% end %>
		</ul>
	<% end %>
	<%= link_to("Edit", { :action => "edit", :id => @incident}) %>
<% end %>
